//
//  ZTTypeConvert.h
//  ZHYYTool
//
//  Created by MT-SW-005 on 2021/9/17.
//  Copyright © 2021 MT-SW-005. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface ZTTypeConvert : NSObject

/*将分割的字符串通过分隔符合并 */
+ (NSString *)joinString:(NSString *)aString withSplitString:(NSString *)SplitString;

/* 通过正则匹配自动合并分割字符串*/
+ (NSString *)autoJoinString:(NSString *)aString;

/* 字符串转换为数组*/
+ (NSMutableArray*)stringToArray:(NSString*)str;

/* 字符串通过分割符转换为数组,分隔符可以多种*/
+ (NSArray *)autoStringToArray:(NSString *)aString;

/* 字符串按照分割符转换为数组*/
+(NSArray *)stringToArray:(NSString*)aString WithSplit:(NSString *)split;

/* 数组合并为字符串*/
+(NSString *)arrayToString:(NSArray*)array;

/*
把数组合并为字符串，通过分隔符连接,默认不用连接符合并
*/
+(NSString *)joinStringFormArray:(NSArray*)arr byString:(nullable NSString*)split;

/* NSString 转化为 NSData*/
+(NSData*)stringToData:(NSString*)string;

/* NSData 转化为 NSString */
+(NSString*)dataToString:(NSData*)data;

/* json字符串 转化为 NSDictorary*/
+(NSDictionary*)jsonStringToDictonary:(NSString*)string;

/* NSDictorary 转化为 字符串*/
+(NSString*)dictToString:(NSDictionary*)dict;

/* NSArray 转化为 NSData*/
+(NSData*)arrayToData:(NSArray*)array;

/* NSData 转化为 NSArray */
+(NSArray*)dataToArray:(NSData*)data;

/* NSDictorary 转化为 NSData*/
+(NSData*)dictToData:(NSDictionary*)dict;

/* NSData 转化为 NSDictorary */
+(NSDictionary*)dataToDict:(NSData*)data;

/* 把标准json字符串转化为NSDictorary NSArray*/
+(id)jsonToDictOrArray:(NSString*)json;

/* 把oc对象NSDictorary NSArray转化为json字符串*/
+(NSString*)objToJson:(id)obj;

/* 反转字符串*/
+(NSString*)reverseString:(NSString *)aString;


/*
 C语言字符串转化成OC字符串
 */
+(NSString*)charToString:(char*)cStr;


/*
 OC语言字符串转化成C字符串
 */
+ (const char*)stringToChar:(NSString*)aString;
  
@end

NS_ASSUME_NONNULL_END
